package online.yangcloud.core.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import online.yangcloud.common.annotation.DataColumn;
import online.yangcloud.common.annotation.DataIndex;
import online.yangcloud.common.annotation.DataTable;
import online.yangcloud.common.enumration.ColumnTypeEnum;
import online.yangcloud.common.model.BaseParameter;
import org.springframework.stereotype.Component;

/**
 * @author zhuboyang
 * @since 2023年11月02 10:25:37
 */
@Table(value = "preview_convert_task")
@DataTable(tableName = "preview_convert_task", desc = "转换任务表")
@Component
public class PreviewConvertEntity extends BaseParameter {

    /**
     * 主键
     */
    @DataColumn(primary = true, name = "id", type = ColumnTypeEnum.VARCHAR, length = 32, canNull = false)
    @DataIndex(unique = true)
    @Id(value = "id")
    private String id;

    /**
     * 文件 id
     */
    @DataColumn(name = "file_id", type = ColumnTypeEnum.VARCHAR, length = 32, canNull = false, comment = "文件 id")
    @DataIndex
    @Column(value = "file_id")
    private String fileId;

    /**
     * 是否已完成
     */
    @DataColumn(name = "is_over", type = ColumnTypeEnum.TINYINT, defaultValue = "0", comment = "是否已完成，默认 0 未完成")
    @DataIndex
    @Column(value = "is_over")
    private Integer isOver;

    public static PreviewConvertEntity builder() {
        return new PreviewConvertEntity();
    }

    public String getId() {
        return id;
    }

    public PreviewConvertEntity setId(String id) {
        this.id = id;
        return this;
    }

    public String getFileId() {
        return fileId;
    }

    public PreviewConvertEntity setFileId(String fileId) {
        this.fileId = fileId;
        return this;
    }

    public Integer getIsOver() {
        return isOver;
    }

    public PreviewConvertEntity setIsOver(Integer isOver) {
        this.isOver = isOver;
        return this;
    }

    @Override
    public String toString() {
        return "PreviewConvertTask["
                + " id=" + id + ","
                + " fileId=" + fileId + ","
                + " isOver=" + isOver + ","
                + " ]"
                + " "
                + super.toString();
    }
}
